package com.heima.user.controller;

import com.heima.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AppLoginDto;
import com.heima.user.service.ApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class LoginController {

    @Autowired
    private ApUserService apUserService;
    /**
     * app 用户登录
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/login/login_auth")
    public ResponseResult<Map<String,Object>> login(@RequestBody AppLoginDto dto){

        return ResponseResult.ok(apUserService.login(dto));

    }
}
